- if @photo
  - if @photo.is_purchasable? && @gallery.purchasable?
    - if logged_in?
      - unless current_user.has_in_cart?(@photo)
        = link_to_remote "add to cart", :url => {:action => :create, :controller => :items, :render => :partial, :item => {:photo_id => @photo.id}, :gallery_id => @gallery.id}, :update => "photo_#{@photo.id.to_s}_description", :html => {:class => "MultiBoxCloseFromLink", :title => "Add this photo to your shopping cart", :onclick => ((@photo == @gallery.all_items.last) ? "box.close()" : "box.next()")}
      - else
        This photo is already in
        %a{:href => orders_url, :title => "Your shopping cart"} your cart.
        You can
        = link_to_remote "add it again", :url => {:action => :create, :controller => :items, :render => :partial, :item => {:photo_id => @photo.id}, :gallery_id => @gallery.id}, :update => "photo_#{@photo.id.to_s}_description", :html => {:class => "MultiBoxCloseFromLink", :title => "Add this photo to your shopping cart", :onclick => ((@photo == @gallery.all_items.last) ? "box.close()" : "box.next()")}
        if you like.
    - else
      This video is available for purchase, but you have to
      %a{:href => login_url, :title => "Login"}login
      or
      %a{:href => signup_url, :title => "Sign Up"}sign up
      to be able to do so.
- elsif @video
  - if @video.is_purchasable?  && @gallery.purchasable?
    - if logged_in?
      - unless current_user.has_in_cart?(@video)
        = link_to_remote "add to cart", :url => {:action => :create, :controller => :items, :render => :partial, :item => {:video_id => @video.id}, :gallery_id => @gallery.id}, :update => "video_#{@video.id.to_s}_description", :html => {:class => "MultiBoxCloseFromLink", :title => "Add this video to your shopping cart", :onclick => ((@video == @gallery.all_items.last) ? "box.close()" : "box.next()")}
      - else
        This video is already in 
        %a{:href => orders_url, :title => "Your shopping cart"} your cart.
        You can
        = link_to_remote "add it again", :url => {:action => :create, :controller => :items, :render => :partial, :item => {:video_id => @video.id}, :gallery_id => @gallery.id}, :update => "video_#{@video.id.to_s}_description", :html => {:class => "MultiBoxCloseFromLink", :title => "Add this video to your shopping cart", :onclick => ((@video == @gallery.all_items.last) ? "box.close()" : "box.next()")}
        if you like.
    - else
      This video is available for purchase, but you have to
      %a{:href => login_url, :title => "Login"}login
      or
      %a{:href => signup_url, :title => "Sign Up"}sign up
      to be able to do so.